/**
 * @see[微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/ui.html#wxsettopbartextobject)
 * @param text [string] 页面标题
 */
export default function setTopBarText(text: string) {
	return new Promise<boolean>((resolve, reject) => {
		wx.setTopBarText({
			text,
			success() {
				resolve(true);
			},
			fail(res) {
				reject(res.errMsg);
			}
		});
	});
}
